<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateDeptZones extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        if (Schema::hasTable('dept_zone')) {
            return;
        }
        Schema::create('dept_zone', function (Blueprint $table) {
            $table->id();
            $table->unsignedInteger('dept_id')->comment('部门ID');
            $table->unsignedInteger('city_id')->comment('城市(省份)ID');
            $table->integer('create_time')->nullable();
            $table->integer('update_time')->nullable();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('dept_zones');
    }
}
